<template>
  <div id="guanzhu">
    <infoIn :trs="true">
      <template #Center> 我的工作 </template>
    </infoIn>
    <div class="jiaShi" v-for="(item, index) in listS" :key="index">
      <div>
        <img :src="item.avatar" />
        <span>
          <p>{{ item.teacher_name }}</p>
          <p>{{ item.introduction }}</p>
        </span>
      </div>
      <div>
        <button @click="asd(item.collect_id)">取消关注</button>
      </div>
    </div>
  </div>
</template>
<script>
import infoIn from "@/views/infoin.vue";
import { getCollect, getColl, getCancel } from "./yibu/my";
export default {
  components: {
    infoIn,
  },
  data() {
    return {
      listS: [],
      listZ: "",
    };
  },
  mounted() {
    this.getCol();
  },
  methods: {
    async getCol() {
      let res = await getCollect();
      this.listS = res.data.data.list;
      console.log(res);
    },
    async asd(id) {
      let res = await getCancel(id);
      console.log(res);
      this.getCol();
    },
  },
};
</script>
<style lang="scss" scoped>
#guanzhu {
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.1);
  .jiaShi {
    height: 80px;
    background-color: white;
    margin: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    > div {
      flex: 1;
    }
    > div:nth-child(1) {
      display: flex;
      align-items: center;
      img {
        width: 40px;
        height: 40px;
        margin-left: 30px;
      }
      span {
        padding-left: 10px;
      }
    }
    > div:nth-child(2) {
      display: flex;
      align-items: center;
      justify-content: space-around;
      button {
        width: 60px;
        height: 30px;
        border-radius: 40px;
        border: none;
        font-size: 12px;
      }
    }
  }
}
</style>